<!--
 * @Author       : wfl
 * @LastEditors  : wfl
 * @description  :
 * @updateInfo   :
 * @Date         : 2023-03-20 16:30:41
 * @LastEditTime : 2023-05-26 17:47:26
-->
<!--
 * @Author: wfl
 * @LastEditors: wfl
 * @description:
 * @updateInfo:
 * @Date: 2023-03-20 16:30:41
 * @LastEditTime: 2023-04-13 18:42:56
-->
<script lang="ts" setup name="IkCopyright">
import useSettingsStore from '@g/store/modules/settings'

const route = useRoute()
const settingsStore = useSettingsStore()
</script>

<template>
  <footer v-if="route.meta.copyright ?? settingsStore.settings.copyright.enable" class="copyright">
    <span>Copyright</span>
    <IkSvgIcon name="i-ri:copyright-line" />
    <span v-if="settingsStore.settings.copyright.dates">{{ settingsStore.settings.copyright.dates }}</span>
    <template v-if="settingsStore.settings.copyright.company">
      <a
        v-if="settingsStore.settings.copyright.website"
        :href="settingsStore.settings.copyright.website"
        target="_blank"
        rel="noopener"
      >{{ settingsStore.settings.copyright.company }}</a>
      <span v-else>{{ settingsStore.settings.copyright.company }}</span>
    </template>
    <a
      v-if="settingsStore.settings.copyright.beian"
      href="https://beian.miit.gov.cn/"
      target="_blank"
      rel="noopener"
    >{{ settingsStore.settings.copyright.beian }}</a>
  </footer>
</template>

<style lang="scss" scoped>
.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  height: 60px;
  background-color: var(--ik-sub-sidebar-bg);

  span,
  a {
    padding: 0 5px;
  }

  .el-icon {
    margin: 0 2px;
  }

  a {
    text-align: center;
    text-decoration: none;
    color: var(--el-text-color-secondary);
    transition: var(--el-transition-color);

    &:hover {
      color: var(--el-text-color-primary);
    }
  }
}
</style>
